<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>德宝奥服务单</title>
<link rel="stylesheet"
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
	integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
	crossorigin="anonymous">

<style>
.nc-table .nc-header-bg {
	background: #f5f7fa;
}

.nc-table, .nc-table tr th, .nc-table tr td {
	/*border: 1px solid #ebeef5;*/
	border: 1px solid #999;
}

.nc-table tr th, .nc-table tr td {
	padding: 6px 10px;
	font-size: 12px; /*color: #606266;*/
	color: #000;
}

.nc-table {
	border-collapse: collapse;
	width: 100%;
}

.page-title {
	font-size: 15px;
	margin: 10px auto;
	text-align: center;
}

.text-bold {
	font-weight: bold;
}

.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox],
	.radio input[type=radio], .radio-inline input[type=radio] {
	margin-top: 2px;
}
</style>

</head>

<body>
	<h3 class="page-title">德宝奥服务清单</h3>

	<table class="nc-table">
		<tr>
			<td style="width: 12%;">客户姓名</td>
			<td style="width: 13%;">${bill.nickName}</td>

			<td style="width: 12%;">客户电话</td>
			<td style="width: 13%;">${bill.tel}</td>

			<td style="width: 12%;">是否会员</td>
			<td style="width: 13%;">${bill.memberLevelStr}</td>

			<td style="width: 12%;">接车时间</td>
			<td style="width: 13%;"><fmt:formatDate
					value="${bill.startTime }" pattern="yyyy-MM-dd" /></td>
		</tr>
		<tr>
			<td>车牌号</td>
			<td>${bill.licenseNo}</td>

			<td>车型</td>
			<td>${bill.brandDesc}</td>

			<td>行驶里程</td>
			<td>${bill.mileage}</td>

			<td>交车时间</td>
			<td></td>
		</tr>

		<!--问题描述-->
		<tr>
			<td colspan="8" class="text-center text-bold">问题描述</td>
		</tr>
		<tr>
			<td colspan="8"><c:forEach items="${problem.itemList }"
					var="item">
					<label class="checkbox-inline"> <input type="checkbox"
						<c:if test="${item.isCheck eq 1 }">checked</c:if>>
						${item.title } <c:if test="${item.hasInput eq 1 }">
							<span
								style="border-bottom: 1px solid #606266; margin-left: -5px;">${item.inputVal }</span>
						</c:if>
					</label>
				</c:forEach></td>
		</tr>
		<tr>
			<td colspan="4">
				<div class="mbpi-cell-text mbpi-cell-requirement">
					<span class="text-bold">用户需求：</span> ${problem.requirement}
				</div>
			</td>
			<td colspan="4">
				<div class="mbpi-cell-text mbpi-cell-requirement">
					<span class="text-bold">维修建议：</span> ${problem.advice}
				</div>
			</td>
		</tr>
	</table>

	<!--环车检查-->
	<table class="nc-table" style="margin-top: -1px;">
		<tr>
			<td colspan="10" class="text-center text-bold">环车检查</td>
		</tr>
		<tr>
			<td colspan="2" class="text-center" style="width: 20%;">备注项目</td>
			<td colspan="3" class="nc-disable-radio-wrapper" style="width: 30%;">
				旧件： <label class="checkbox-inline"> <input type="checkbox"
					<c:if test="${check.oldPartsHandle eq 1 }">checked</c:if>>带走
			</label> <label class="checkbox-inline"> <input type="checkbox"
					<c:if test="${check.oldPartsHandle eq 2 }">checked</c:if>>不带走
			</label>
			</td>
			<td colspan="5" style="width: 50%;">外观检查：有损坏（&nbsp;&nbsp;<span
				class="text-bold">${check.badOuterNum}</span>&nbsp;&nbsp;） 处
			</td>
		</tr>
		<tr>
			<td colspan="10">
				<div class="mbpi-cell-text mbpi-cell-requirement">
					<span class="text-bold">漆面情况：</span> ${check.paintDesc}
				</div>
			</td>
		</tr>
		<tr>
			<td class="text-center" colspan="5" style="width: 50%;"><span>${fn:length(check.itemList) }</span>
				项必检</td>
			<td class="text-center" colspan="1" style="width: 10%;">正常</td>
			<td class="text-center" colspan="1" style="width: 10%;">非正常</td>
			<td class="text-center" colspan="1" style="width: 10%;">已处理</td>
			<c:if test="${not empty check.itemList }">
				<td colspan="2" style="width: 20%;"
					rowspan="${fn:length(check.itemList) + 1 }"></td>
			</c:if>
			<c:if test="${empty check.itemList }">
				<td colspan="2" style="width: 20%;" rowspan="2"></td>
			</c:if>
		</tr>
		<c:if test="${empty check.itemList }">
			<tr>
				<td colspan="5"></td>

				<td colspan="1"></td>
				<td colspan="1"></td>
				<td colspan="1"></td>

			</tr>
		</c:if>
		<c:if test="${not empty check.itemList }">
			<c:forEach items="${check.itemList }" var="item" varStatus="iIndex">
				<tr>
					<td colspan="5">${iIndex.index + 1}、${item.title}</td>
					<td class="text-center" colspan="1"><c:if
							test="${item.isNormal eq 1 }">
							<i class="glyphicon glyphicon-ok"></i>
						</c:if></td>
					<td class="text-center" colspan="1"><c:if
							test="${item.isNormal eq 0 }">
							<i class="glyphicon glyphicon-remove"></i>
						</c:if></td>
					<td class="text-center" colspan="1"><c:if
							test="${item.isHandle eq 1 }">
							<i class="glyphicon glyphicon-ok"></i>
						</c:if></td>

				</tr>
			</c:forEach>
		</c:if>

		<!--维修项目-->
		<tr>
			<td colspan="3" class="text-center" style="width: 30%;">维修项目</td>
			<td colspan="1" class="text-center" style="width: 10%;">工时</td>
			<td colspan="3" class="text-center" style="width: 30%;">材料</td>
			<td colspan="1" class="text-center" style="width: 10%;">单价 ¥</td>
			<td colspan="1" class="text-center" style="width: 10%;">数量</td>
			<td colspan="1" class="text-center" style="width: 10%;">金额 ¥</td>

		</tr>
		<c:if test="${empty maintainItemList }">
			<c:forEach items="[1,2,3]" var="i">
				<tr>
					<td colspan="3">&nbsp;</td>
					<td></td>
					<td colspan="3"></td>
					<td></td>
					<td></td>
					<td></td>
				</tr>
			</c:forEach>
		</c:if>
		<c:forEach items="${maintainItemList }" var="item" varStatus="iIndex">
			<tr>
				<td colspan="3">${iIndex.index + 1}、${item.title}</td>
				<td class="text-center">${item.hours}</td>
				<td colspan="3" class="text-center">${item.productTitle}</td>
				<td class="text-center">${item.price}</td>
				<td class="text-center">${item.num}</td>
				<td class="text-center">${item.money}</td>
			</tr>
		</c:forEach>
		<tr>
			<td colspan="10" class="text-center">合计：¥ ${bill.money}</td>
		</tr>
		<tr>
			<td colspan="10" class="text-center nc-disable-radio-wrapper"><label
				class="checkbox-inline"> <input type="checkbox" value="1"
					<c:if test="${bill.payWay eq 1 }">checked</c:if>> 现金
			</label> <label class="checkbox-inline"> <input type="checkbox"
					value="2" <c:if test="${bill.payWay eq 2 }">checked</c:if>>
					微信
			</label> <label class="checkbox-inline"> <input type="checkbox"
					value="3" <c:if test="${bill.payWay eq 3 }">checked</c:if>>
					支付宝
			</label> <label class="checkbox-inline"> <input type="checkbox"
					value="4" <c:if test="${bill.payWay eq 4 }">checked</c:if>>
					刷卡
			</label> <label class="checkbox-inline"> <input type="checkbox"
					value="5" <c:if test="${bill.payWay eq 5 }">checked</c:if>>
					平台
			</label></td>
		</tr>
		<tr>
			<td colspan="5" class="text-center"><span>主修人：&nbsp;&nbsp;${bill.repairName }</span>
			</td>
			<td colspan="5" class="text-center"><span>质检人：&nbsp;&nbsp;${bill.qualityName }</span>
			</td>
		</tr>
		<tr>
			<td colspan="5" class="text-center"><span class="text-bold">接车人签字：</span>
			</td>
			<td colspan="5" class="text-center"><span class="text-bold">顾客签字：</span>
			</td>
		</tr>
	</table>
</body>
</html>
